<!-- 经典影片-->
<template>
  <div>
    <sn-row-has-two-col
        class="margin-bottom"
        :left="21" :right="3">
      <div slot="one-col" class="to-flex">
        <sn-text
            :font-size="25"
            font-color="#E6A23C"
            text="经典影片"/>
      </div>
      <el-link
          :underline="false"
          @click="toAllOldMovie"
          type="warning"
          slot="two-col">
        <sn-text
            :move-down="7"
            :font-size="20"
            text="全部 >"/>
      </el-link>
    </sn-row-has-two-col>
    <old-movie-row :old-movie-data="firstRow"/>
    <old-movie-row :old-movie-data="secondRow"/>
  </div>
</template>

<script>
import OldMovieRow from "@/views/home/left/old_movie/OldMovieRow";

export default {
  name: "OldMovie",
  components: {
    OldMovieRow
  },
  data() {
    return {
      firstRow: [],
      secondRow: []
    }
  },
  methods: {
    toAllOldMovie() {
      this.$router.push({
        name: 'movieList',
        params: {
          beOnStatus: 3
        }
      })
    },
    getWillOnData() {
      this.$http({
        url: '/web/movie/index/getHighBoxOfficeMovie',
        method: 'get',
        params: this.$http.adornParams({
          'page': '1',
          'limit': '8',
        })
      }).then(({data}) => {
        let highBoxOfficeData = data.data
        for (let item of highBoxOfficeData) {
          item.boxOffice = Number(item.boxOffice).toFixed(1)
        }
        this.firstRow.push(highBoxOfficeData[0])
        this.firstRow.push(highBoxOfficeData[1])
        this.firstRow.push(highBoxOfficeData[2])
        this.firstRow.push(highBoxOfficeData[3])
        this.secondRow.push(highBoxOfficeData[4])
        this.secondRow.push(highBoxOfficeData[5])
        this.secondRow.push(highBoxOfficeData[6])
        this.secondRow.push(highBoxOfficeData[7])
      })
    },
  },
  created() {
    this.getWillOnData()
  }
}
</script>

<style scoped>

</style>
